package GenericData;

import GenericData.entity.User;
import GenericData.service.GenericDAO;
import GenericData.service.impl.UserDAO;

import java.util.List;

/*
 * Author: JacksonCoder
 * FileName: main
 * Version: 1.0.0
 */
public class Main {
    public static void main(String[] args) {
        GenericDAO<User> userDAO = new UserDAO();

        // 保存用户
        userDAO.save(new User(1, "张三"));
        userDAO.save(new User(2, "李四"));

        // 查找用户
        User user = userDAO.findById(1);
        System.out.println("找到的用户： " + user);

        // 查找所用用户
        List<User> allUsers = userDAO.findAll();
        System.out.println("所有用户： " + allUsers);
    }

}
